package com.csvc.business.cmdb.service.impl;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.csvc.business.cmdb.service.IMysqlInfoService;
import com.csvc.repository.cmdb.domain.MysqlInfo;
import com.csvc.repository.cmdb.mapper.MysqlInfoMapper;

/**
* <p>
    *  服务实现类
    * </p>
*
* @author vincent zou
* @since 2020-12-29
*/
@Service
    public class MysqlInfoServiceImpl extends ServiceImpl<MysqlInfoMapper, MysqlInfo> implements IMysqlInfoService {
    @Override
    public boolean create(MysqlInfo mysqlInfo) {
    return super.save(mysqlInfo);
    }

    @Override
    public boolean remove(Long id) {
    return super.removeById(id);
    }

    @Override
    public boolean update(MysqlInfo mysqlInfo) {
    return super.updateById(mysqlInfo);
    }

    @Override
    public MysqlInfo get(Long id) {
    return super.getById(id);
    }

    @Override
    public IPage<MysqlInfo> page(int current, int size, MysqlInfo mysqlInfo) {
    Page<MysqlInfo> page = new Page<>(current, size);
    LambdaQueryWrapper<MysqlInfo> wrapper = new LambdaQueryWrapper<>();

    // TODO 查询
    // TODO 排序

    return super.page(page, wrapper);
    }
    }
